package com.wei.classloader;

import com.sun.java.accessibility.util.EventID;
import com.sun.nio.sctp.HandlerResult;

/**
 * @Author :sunwei
 * @Description:
 * @Date create in 22:56  2021/3/15
 * @Modified by:
 */
public class ClassLoaderTest {
    public static void main(String[] args) {
        //核心类库由BootstrapClassLoader加载
        ClassLoader classLoader = String.class.getClassLoader();
        System.out.println(classLoader);

        //ext下的类由扩展类加载器sun.misc.Launcher$ExtClassLoader加载
        ClassLoader classLoader1 = EventID.class.getClassLoader();
        System.out.println(classLoader1);

        //用户自定义的类由系统类加载器sun.misc.Launcher$AppClassLoader加载
        ClassLoader classLoader2 = ClassLoaderTest.class.getClassLoader();
        System.out.println(classLoader2);
    }
}
